The present invention relates to a data processor and, more particularly, to a microcomputer including an analog-to-digital converter (called hereinafter an "A/D converter") for converting a plurality of analog input channels int the corresponding digital data.
A microcomputer including an A/D converter can perform a data processing operation on an analog signal supplied thereto and is thus widely employed in various systems. When data processing on the analog signal is requested, a CPU (Central Processing Unit) in the microcomputer supplies a converting command to the A/D converter and then receives the converted data to perform the requested processing operation thereon.
There is a serious problem in the operation of the CPU after supplying the converting command to the A/D converter. The time required by the A/D converter to convert the analog signal into the digital data is considerably longer than the time required by the CPU to execute one instruction. A first prior art control method, in which subsequent processing operations by the CPU are stopped until the converted digital data is derived from the A/D converter, lowers the executing efficiency of the CPU. In order to solve this problem, a second prior art control method is employed in which the CPU continues to perform the subsequent operations after supplying the converting command to the A/D converter and the A/D converter generates an interruption request to the CPU when completing the converting operation. When the interruption request is generated, the CPU suspends operations in a main program routine and saves the contents of a program counter and a status register into a stack area of a data memory, and starts operation in an interruption program routine. The program counter is used for reading each instruction out of a program memory and the status register stores status data representative of an executing condition of the CPU. In accordance with the operation in the interruption program routine, the CPU reads the converted data from the A/D converter and transfers it to a predetermined destination area of the data memory. When the operation in the interruption program routine is completed, the CPU returns the saved contents to the program counter and the status register, and then resumes the operation in the main program routine. Thus, the second control method can enhance the execution efficiency of the CPU. However, in order for the CPU to start to execute the interruption program routine and resume the suspended main program routine, overheads are required for saving the contents of the program counter and the status register and for returning the saved contents thereto, respectively. For this reason, this control method restricts the execution efficiency and processing capability of the CPU.
In order to overcome the drawbacks of the first and second control methods, therefore, a new control method has been disclosed in a copending application Ser. No. 06,707,617 filed on Mar. 4, 1985. This control method performs the operation responsive to the completion of the A/D conversion, i.e. the transfer of the converted data to the destination area, without intervention of any user's program operation. More specifically, the microcomputer disclosed in the above copending application is constructed to perform two types of interruption operation, the first one of which is executed by use of a user's interruption program and is thus required to save the contents of the program counter and the status register and the second one of which is executed by without use of a user's interruption program by holding the contents of the program counter and status register. When the A/D converter generates the interruption request by designating the second type of interruption operation, the CPU suspends the program operation which is currently being executed, inhibits the contents of the program counter and status register from being varied, and then transfers the converted data to the destination area without saving the contents of the program counter and status register and by holding them as they are. After the converted data is transferred to the destination area, the CPU allows the program counter and status register to change to resume the suspended program operation. The second type of interruption operation is also called "macro service operation". With to the macro service operation, the above-mentioned overheads are not required, so that the execution efficiency and processing capability of the CPU are enhanced remarkably.
However, the above copending application discloses the macro service operation for a single analog input channel. Some systems are required to process a plurality of analog input channels, and two or more channels thereof may be simultaneously subjected to the conversion request to perform a desired operation.